package com.kingdee.eas.fdc.propertymgmt.app;

import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import com.kingdee.eas.framework.Result;
import com.kingdee.eas.framework.LineResult;
import com.kingdee.eas.framework.exception.EASMultiException;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;

import com.kingdee.eas.fdc.crm.basedata.BuildingCollection;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.eas.fdc.propertymgmt.MeterSortInfo;
import com.kingdee.eas.framework.CoreBaseCollection;
import com.kingdee.eas.fdc.crm.basedata.BuildingUnitCollection;
import com.kingdee.eas.fdc.crm.basedata.SellProjectInfo;
import com.kingdee.eas.framework.CoreBillBaseCollection;
import com.kingdee.eas.fdc.crm.basedata.BuildingUnitInfo;
import com.kingdee.eas.fdc.basedata.FDCBillCollection;
import com.kingdee.eas.fdc.propertymgmt.MeterReadingBillInfo;
import com.kingdee.eas.fdc.propertymgmt.MeterSpecInfo;
import com.kingdee.eas.fdc.propertymgmt.MeterReadingBillCollection;
import java.lang.String;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.eas.fdc.propertymgmt.PPMBillCollection;
import java.util.Map;
import java.util.Date;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.eas.fdc.crm.basedata.RoomCollection;
import com.kingdee.eas.fdc.propertymgmt.MeterReadingBillEntryCollection;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.fdc.crm.basedata.BuildingInfo;
import com.kingdee.eas.fdc.propertymgmt.PPMProjectBillCollection;
import com.kingdee.eas.framework.ObjectBaseCollection;
import com.kingdee.eas.fdc.crm.basedata.MoneyDefineInfo;



public abstract class AbstractMeterReadingBillControllerBean extends PPMProjectBillControllerBean implements MeterReadingBillController
{
    protected AbstractMeterReadingBillControllerBean()
    {
    }

    protected BOSObjectType getBOSType()
    {
        return new BOSObjectType("43504421");
    }

    public MeterReadingBillInfo getMeterReadingBillInfo(Context ctx, IObjectPK pk) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("a8d82c6c-8c6e-4fa7-b898-cd7027ae1e82"), new Object[]{ctx, pk});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillInfo retValue = (MeterReadingBillInfo)_getValue(ctx, pk);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
        
          return (MeterReadingBillInfo)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectValue _getValue(Context ctx, IObjectPK pk) throws BOSException, EASBizException
    {
        return super._getValue(ctx, pk);
    }

    public MeterReadingBillInfo getMeterReadingBillInfo(Context ctx, IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("0bed8c99-bcb5-4ef2-b58f-bdd87cce6721"), new Object[]{ctx, pk, selector});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillInfo retValue = (MeterReadingBillInfo)_getValue(ctx, pk, selector);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
        
          return (MeterReadingBillInfo)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectValue _getValue(Context ctx, IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException
    {
        return super._getValue(ctx, pk, selector);
    }

    public MeterReadingBillInfo getMeterReadingBillInfo(Context ctx, String oql) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("d2068b40-4e99-4ab0-8126-0a57468020ac"), new Object[]{ctx, oql});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillInfo retValue = (MeterReadingBillInfo)_getValue(ctx, oql);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
        
          return (MeterReadingBillInfo)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectValue _getValue(Context ctx, String oql) throws BOSException, EASBizException
    {
        return super._getValue(ctx, oql);
    }

    public MeterReadingBillCollection getMeterReadingBillCollection(Context ctx) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("a3d36804-dbaa-4683-bed9-637fa1c94900"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillCollection retValue = (MeterReadingBillCollection)_getCollection(ctx, svcCtx);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
        
          return (MeterReadingBillCollection)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx) throws BOSException
    {
        return super._getCollection(ctx, svcCtx);
    }

    public MeterReadingBillCollection getMeterReadingBillCollection(Context ctx, EntityViewInfo view) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("7fae9241-a579-407f-9fa6-f90d9b8df2a4"), new Object[]{ctx, view});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillCollection retValue = (MeterReadingBillCollection)_getCollection(ctx, svcCtx, view);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
        
          return (MeterReadingBillCollection)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx, EntityViewInfo view) throws BOSException
    {
        return super._getCollection(ctx, svcCtx, view);
    }

    public MeterReadingBillCollection getMeterReadingBillCollection(Context ctx, String oql) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("8c9551d1-9014-4dec-b611-bee5ecabe8ac"), new Object[]{ctx, oql});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillCollection retValue = (MeterReadingBillCollection)_getCollection(ctx, svcCtx, oql);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
        
          return (MeterReadingBillCollection)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx, String oql) throws BOSException
    {
        return super._getCollection(ctx, svcCtx, oql);
    }

    public MeterReadingBillCollection batchAdd(Context ctx, SellProjectInfo sellProjectInfo, MoneyDefineInfo chargeItemInfo, BuildingCollection buidlings, Date endDate, boolean isOverride) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("02c5d371-ca49-44f4-bbd6-f906665cbf94"), new Object[]{ctx, sellProjectInfo, chargeItemInfo, buidlings, endDate, new Boolean(isOverride)});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillCollection retValue = (MeterReadingBillCollection)_batchAdd(ctx, sellProjectInfo, chargeItemInfo, buidlings, endDate, isOverride);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (MeterReadingBillCollection)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract IObjectCollection _batchAdd(Context ctx, SellProjectInfo sellProjectInfo, MoneyDefineInfo chargeItemInfo, BuildingCollection buidlings, Date endDate, boolean isOverride) throws BOSException, EASBizException;

    public void checkRemove(Context ctx, MeterReadingBillInfo vo) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("ec606dea-2d62-472b-bb1a-5c64f6562ff3"), new Object[]{ctx, vo});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _checkRemove(ctx, vo);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _checkRemove(Context ctx, IObjectValue vo) throws BOSException, EASBizException;

    public boolean transfer(Context ctx, IObjectPK pk) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("5481d0b2-c1d7-4ee3-b1d2-ed0c8f5bd5d6"), new Object[]{ctx, pk});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            boolean retValue = (boolean)_transfer(ctx, pk);
            svcCtx.setMethodReturnValue(new Boolean(retValue));
            }
            invokeServiceAfter(svcCtx);
            return ((Boolean)svcCtx.getMethodReturnValue()).booleanValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract boolean _transfer(Context ctx, IObjectPK pk) throws BOSException, EASBizException;

    public MeterReadingBillEntryCollection batchAddByUnit(Context ctx, SellProjectInfo sellProject, MoneyDefineInfo chargeItemInfo, BuildingUnitCollection buildingUnits, Date endDate, boolean isOverride) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("566f9b7a-767d-4963-b851-2b888ff13f86"), new Object[]{ctx, sellProject, chargeItemInfo, buildingUnits, endDate, new Boolean(isOverride)});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillEntryCollection retValue = (MeterReadingBillEntryCollection)_batchAddByUnit(ctx, sellProject, chargeItemInfo, buildingUnits, endDate, isOverride);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (MeterReadingBillEntryCollection)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract IObjectCollection _batchAddByUnit(Context ctx, SellProjectInfo sellProject, MoneyDefineInfo chargeItemInfo, BuildingUnitCollection buildingUnits, Date endDate, boolean isOverride) throws BOSException, EASBizException;

    public MeterReadingBillEntryCollection batchAddByRoom(Context ctx, SellProjectInfo sellProject, MoneyDefineInfo chargeItemInfo, RoomCollection roomInfos, Date endDate, boolean isOverride) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("4d0dd135-aa1f-430b-a791-98e06eb6410d"), new Object[]{ctx, sellProject, chargeItemInfo, roomInfos, endDate, new Boolean(isOverride)});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillEntryCollection retValue = (MeterReadingBillEntryCollection)_batchAddByRoom(ctx, sellProject, chargeItemInfo, roomInfos, endDate, isOverride);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (MeterReadingBillEntryCollection)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract IObjectCollection _batchAddByRoom(Context ctx, SellProjectInfo sellProject, MoneyDefineInfo chargeItemInfo, RoomCollection roomInfos, Date endDate, boolean isOverride) throws BOSException, EASBizException;

    public MeterReadingBillEntryCollection batchGenerator(Context ctx, SellProjectInfo sellProjectInfo, BuildingInfo building, BuildingUnitInfo buildUnit, MeterSortInfo meterSortInfo, MeterSpecInfo meterSpecInfo, boolean isPublicMeter, Map pareMap) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("df208fb1-85c0-4e80-b523-768bbf900ee5"), new Object[]{ctx, sellProjectInfo, building, buildUnit, meterSortInfo, meterSpecInfo, new Boolean(isPublicMeter), pareMap});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            MeterReadingBillEntryCollection retValue = (MeterReadingBillEntryCollection)_batchGenerator(ctx, sellProjectInfo, building, buildUnit, meterSortInfo, meterSpecInfo, isPublicMeter, pareMap);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (MeterReadingBillEntryCollection)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract IObjectCollection _batchGenerator(Context ctx, SellProjectInfo sellProjectInfo, BuildingInfo building, BuildingUnitInfo buildUnit, MeterSortInfo meterSortInfo, MeterSpecInfo meterSpecInfo, boolean isPublicMeter, Map pareMap) throws BOSException;

    public PPMProjectBillCollection getPPMProjectBillCollection (Context ctx) throws BOSException
    {
    	return (PPMProjectBillCollection)(getMeterReadingBillCollection(ctx).cast(PPMProjectBillCollection.class));
    }
    public PPMProjectBillCollection getPPMProjectBillCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (PPMProjectBillCollection)(getMeterReadingBillCollection(ctx, view).cast(PPMProjectBillCollection.class));
    }
    public PPMProjectBillCollection getPPMProjectBillCollection (Context ctx, String oql) throws BOSException
    {
    	return (PPMProjectBillCollection)(getMeterReadingBillCollection(ctx, oql).cast(PPMProjectBillCollection.class));
    }
    public PPMBillCollection getPPMBillCollection (Context ctx) throws BOSException
    {
    	return (PPMBillCollection)(getMeterReadingBillCollection(ctx).cast(PPMBillCollection.class));
    }
    public PPMBillCollection getPPMBillCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (PPMBillCollection)(getMeterReadingBillCollection(ctx, view).cast(PPMBillCollection.class));
    }
    public PPMBillCollection getPPMBillCollection (Context ctx, String oql) throws BOSException
    {
    	return (PPMBillCollection)(getMeterReadingBillCollection(ctx, oql).cast(PPMBillCollection.class));
    }
    public FDCBillCollection getFDCBillCollection (Context ctx) throws BOSException
    {
    	return (FDCBillCollection)(getMeterReadingBillCollection(ctx).cast(FDCBillCollection.class));
    }
    public FDCBillCollection getFDCBillCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (FDCBillCollection)(getMeterReadingBillCollection(ctx, view).cast(FDCBillCollection.class));
    }
    public FDCBillCollection getFDCBillCollection (Context ctx, String oql) throws BOSException
    {
    	return (FDCBillCollection)(getMeterReadingBillCollection(ctx, oql).cast(FDCBillCollection.class));
    }
    public CoreBillBaseCollection getCoreBillBaseCollection (Context ctx) throws BOSException
    {
    	return (CoreBillBaseCollection)(getMeterReadingBillCollection(ctx).cast(CoreBillBaseCollection.class));
    }
    public CoreBillBaseCollection getCoreBillBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (CoreBillBaseCollection)(getMeterReadingBillCollection(ctx, view).cast(CoreBillBaseCollection.class));
    }
    public CoreBillBaseCollection getCoreBillBaseCollection (Context ctx, String oql) throws BOSException
    {
    	return (CoreBillBaseCollection)(getMeterReadingBillCollection(ctx, oql).cast(CoreBillBaseCollection.class));
    }
    public ObjectBaseCollection getObjectBaseCollection (Context ctx) throws BOSException
    {
    	return (ObjectBaseCollection)(getMeterReadingBillCollection(ctx).cast(ObjectBaseCollection.class));
    }
    public ObjectBaseCollection getObjectBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (ObjectBaseCollection)(getMeterReadingBillCollection(ctx, view).cast(ObjectBaseCollection.class));
    }
    public ObjectBaseCollection getObjectBaseCollection (Context ctx, String oql) throws BOSException
    {
    	return (ObjectBaseCollection)(getMeterReadingBillCollection(ctx, oql).cast(ObjectBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx) throws BOSException
    {
    	return (CoreBaseCollection)(getMeterReadingBillCollection(ctx).cast(CoreBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (CoreBaseCollection)(getMeterReadingBillCollection(ctx, view).cast(CoreBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx, String oql) throws BOSException
    {
    	return (CoreBaseCollection)(getMeterReadingBillCollection(ctx, oql).cast(CoreBaseCollection.class));
    }
}